ScheduleServiceglobal with sharing class ScheduleService a service that provides functionality relating to schedules. to understand schedules, call this service rather than query Schedule and ScheduleException separately and interpret the results. To make simple updates to existing schedules, call this service rather than use DML on Schedule and ScheduleException separately. Methods
getScheduledHoursForDatesglobal static Map<Id, ScheduleService.HoursDetail> getScheduledHoursForDates(Set<Id> scheduleIds, Date startDate, Date endDate) This method does all the logic of looking at the specified schedules and their schedule exceptions and working out how many hours the resources are scheduled to work on specific dates. Input Parameters
Return ValueA map keyed on Schedule Id. The values detail the scheduled hours after schedule exceptions have been considered. Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. You need to provide some sample code updateSchedulesglobal static List<ScheduleService.UpdateScheduleResponse> updateSchedules(List<ScheduleService.UpdateScheduleRequest> requests) Amends the specified schedules and their schedule exceptions to change specific dates to the hours indicated in the request. If you want to make extensive changes to the schedule, such as changing the pattern for the whole scheduled period or altering the end date, we recommend that you use the SchedulingStrategyService API. The return value contains one response for each request and indicates if the request was valid. For example, a request is invalid if you attempt to change a date outside the range of the schedule. Any DML errors are thrown as exceptions. Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. You need to provide some sample code ScheduleService.HoursDetailglobal class HoursDetail Properties
ScheduleService.UpdateScheduleRequestglobal class UpdateScheduleRequest use instances of this object with updateschedules to edit schedules. Properties
ScheduleService.UpdateScheduleResponseglobal class UpdateScheduleResponse response object returned from updateschedules. Use the ScheduleId to match it to a request. Properties
|